package com.cskaoyan.controller.lz_controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.lzpackage.lz_express.Express;
import com.cskaoyan.mapper.ElseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("admin/config")
public class AdminExpressController {
    @Autowired
    ElseMapper elseMapper;
    @GetMapping("express")
    public BaseRespVo list() {
        String market_express_freight_min= elseMapper.selectExpress("market_express_freight_min");
        String value= elseMapper.selectExpress("market_express_freight_value");
        Express express=new Express();
        express.setMarket_express_freight_min(market_express_freight_min);
        express.setMarket_express_freight_value(value);
        return BaseRespVo.ok(express);
    }
    @PostMapping("express")
    public BaseRespVo list1(@RequestBody Express express) {
        elseMapper.updateExpress("market_express_freight_min",express.getMarket_express_freight_min());
        elseMapper.updateExpress("market_express_freight_value",express.getMarket_express_freight_value());
        return BaseRespVo.out();
    }
}
